home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / dos_win / winsock / maillist / 94-03.Z / 94-03 / text0363.txt < prev    next >
Encoding:
Text File  |  1994-03-30  |  1.6 KB  |  42 lines

  1. >   I have 2 questions on the 1.1 winsock spec regarding FD_WRITE.
  2. >   First,  if a winsock client calls WSAAsyncSelect a second time,  will
  3. >   an FD_WRITE message be sent to the client  (assuming readiness for
  4. >   writing)?  
  5.  
  6. Yes.
  7.  
  8. >   Second,  why are send() and sentto() listed as re-enabling functions
  9. >   for FD_WRITE (on p. 90)?  Each time send() is called the winsock
  10. >   library is not supposed to post an FD_WRITE message,  right?  Only
  11. >   after a send() or sentto() fails,  and then buffer space becomes
  12. >   available,  was my understanding.  Just wanted to make sure...
  13.  
  14. You're understanding of it is correct.  It has reenabling functions
  15. because the FD_WRITE event is "level-triggered" just like all the
  16. other events.  Here's an example of how/when it works:
  17.  
  18.    - you send() successfully
  19.    - you send() successfully
  20.              ...
  21.    - send() fails with WSAEWOULDBLOCK
  22.              ...
  23.    - WinSock DLL sends FD_WRITE to notify you that buffers are again
  24.      available (so you should be able to send() successfully).
  25.              ...
  26.    - You're busy doing other things, or haven't got the message yet
  27.              ...
  28.    - More buffers become available to the WinSock DLL but it DOESN'T
  29.      send another FD_WRITE message to you, because you haven't called
  30.      the "re-enabling function".
  31.  
  32.    - you send() successfully...
  33.  
  34. Granted, it's not as important as the "level triggering" is for
  35. other events, but that's not to say it isn't important.
  36.  
  37. Regards,
  38. --
  39.  Bob Quinn                                             rcq@ftp.com
  40.  FTP Software, Inc.                                No. Andover, MA
  41.  
  42.